package com.aaa.dao;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;
import java.util.Map;

public interface L_PointSetDao {

    @Insert("insert into point_set(unit,content,score,starttime,state,unitid) values(#{unit},#{name},#{score},CURDATE(),0,#{id}) ")
    int SetDao(Map map);

    @Select("select id,score from score")
    List<Map> Score();

    @Select("select * from inspect_info where pid>1")
    List<Map> Content();

    @Select("select * from regist")
    List<Map> getunit();

    @Select("select * from point_set where unit=#{unit} and content=#{name}")
    List<Map> chachong(Map map);


    @Select("select id from regist where name=#{unit}")
    int getunitID(Map map);

    //设置总分
    @Select("update regist a set a.cpscore=#{score}  where  a.`name`=#{unit}")
    void setRegist(Map map);

    @Select("select cpscore from regist where name=#{unit}")
    List<Map> cpscore(Map map);

    @Update("update  regist a  set  a.cpscore=a.cpscore+#{score}  where name=#{unit}")
    void addcpscore(Map map);
}
